package com.example.web;

import com.example.daoman.Chat;
import com.example.utils.Message;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//在线聊天接口实现
@RestController
@RequestMapping("/web")
public class WebSocketInterFace {


//    消息接收
    @MessageMapping("/hello")
    @SendTo("/topic/green")
    public String setHello(){

        System.out.println("连接成功");

        return "chat";
    }

}
